{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "iris = datasets.load_iris()\n",
    "# 为方便可视化，只取后2个特征\n",
    "X = iris.data[:,2:]\n",
    "y = iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAGeFJREFUeJzt3X+wV3Wdx/Hn+365BKHJFFclwLBEmzIVveOPaIpZJ/IHK2wbqbP9oHFzp81Nh2onG2Yjo8kddyw23VxSV91cUtCQxNZlst1qXdwuaLL5K0MLCOWqiUGYcO97//h+gXu/93z5fs73nPs9P76vxwwD33M/55z316Y3h3Nen88xd0dERMqlK+sCREQkfWruIiIlpOYuIlJCau4iIiWk5i4iUkJq7iIiJaTmLiJSQmruIiIlpOYuIlJCY7I68aRJk3z69OlZnV5EpJA2bNjwgrv3NBuXWXOfPn06fX19WZ1eRKSQzOzXIeN0W0ZEpITU3EVESkjNXUSkhNTcRURKSM1dRKSE1NxFREpIzV1EpISa5tzNbBpwG3AU4MByd19WN2Y2cA/wTG3T3e5+VbqlikjRrd28lmUbl/Hc7uc4esLRXH7q5Zz/1vMT7Q8kOmZZhUxi2gd81t03mtnhwAYzW+fuj9WN+4m7z02/RBEpg7Wb17LkwSW8OvAqANt3b2fJg0sAgppx1P6Lf7oYM2Pv4N6WjllmTW/LuPt2d99Y+/PvgceBKa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/BQazLiQFDvyHmW0ws0uzLiaBY4F+4F9qt8tuNLMyvP/yImBF2gdVc88BMzsMuAu4wt1fybqeVrn7gLufQnVxudPNrJC3zcxsLrDD3TdkXUtK3uPup1J94c6na7c2i2gMcCrwLXefCewGvpBtScnUbi1dAKxM+9hq7hmr3Z++C7jd3e/Oup401P6p/CPgnKxradEs4ILavervAn9iZt/JtqTWufu22u87gO9RfQFPEW0Ftg75F+Eqqs2+yM4FNrr782kfWM09Q7WHkDcBj7v7tVnXk4SZ9ZjZxNqfxwPvB57ItqrWuPuV7j7V3adT/SfzA+7+kYzLaomZTag9rKd2C2MOUMikmbs/B2wxsxNqm84GChc+qHMxo3BLBqr/zCkUM1sBzAYmmdlW4EvuflO2VbVsFvBRYFPtXjXAF939vgxratVk4Nbak/8u4E53L3SEsCSOAr5Xe+vlGODf3P3fsy0pkb8Bbq/dztgMfCLjelpW+8v2/cBfjcrxixaFFBGR5nRbRkSkhNTcRURKSM1dRKSE1NxFREpIzV1EpITU3EVESkjNXUSkhNTcRURK6P8BG1cuFCO9lDwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1089622e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 看看3种不同类别绘制出来的分布\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 对其使用决策树进行分类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(class_weight=None, criterion='entropy', max_depth=2,\n            max_features=None, max_leaf_nodes=None,\n            min_impurity_decrease=0.0, min_impurity_split=None,\n            min_samples_leaf=1, min_samples_split=2,\n            min_weight_fraction_leaf=0.0, presort=False, random_state=None,\n            splitter='best')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.tree.tree import DecisionTreeClassifier\n",
    "\n",
    "# max_depth 最高分类次数，是一个超参数\n",
    "# criterion='entropy' 表示使用\"信息熵\"作为分类标准\n",
    "dt_clf = DecisionTreeClassifier(max_depth=2, criterion='entropy')\n",
    "dt_clf.fit(X,y)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制决策边界"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/seamonster/MachineLearningClassicAlgorithmEnv/lib/python3.6/site-packages/matplotlib/contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHBJJREFUeJzt3XuQXPWZ3vHvOxckGEYMWAIJJCMo2LUxWaRlImNry0WtYwKIMi7WJHIcx3ZRq9TGOJBsVSqgFLfYy26lyo7KOHYpQBZ2vbDmYke7iDXesmq5uLiMZLEGiZQVbCKB0ADSSKMbaGbe/NFnZnrOnJ4+ffp0n0s/n6opun/zO6dfidKr1jnPvG3ujoiIlEtX1gWIiEj61NxFREpIzV1EpITU3EVESkjNXUSkhNTcRURKqG5zN7P5Zvaimb1sZq+a2Z0Re+aZ2V+b2S4ze8HMlreiWBERiSfOO/f3gd9390uAFcCVZnZZaM8NwAF3vwD4NvBn6ZYpIiKNqNvcveJw8LQ3+Ar/5NO1wAPB40eBT5uZpValiIg0pCfOJjPrBrYCFwDfdfcX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mnlNmdirwGHCzux/Kup643H3c3VdQ+UnmVWZWmEtjZnYNMOzuW7OupQm/5+6/S2WK69eCy5RF0QP8LvA9d18JHAH+c7YlNS64nPRZ4JEs61Bzz6HgevVjwA/c/fGs60ki+Of0FuDKrGtpwGrgs8F164eB3zezv8y2pMa4+5vBf4eBH1GZ6loUe4A9Vf/ae5RKsy+aq4Bt7r4vyyLU3HMmuCl5H7DT3b+VdT2NMLNFZjYQPD4Z+AzwWrZVxefut7j7UndfTuWf1T9z93+dcVmxmVlfcBOe4HLGFUBhUmPu/jaw28x+O1j6NJD7IEGEL5DxJRlo81TIdjCzh4DLgYVmtge43d3vy7aqhqwGvgT8Mrh2DXCru2/OsKa4lgAPBEmBLuCH7l64OGGBnQX8KPgohR7gr9z977ItqWFfB34QXNp4HfhqxvU0JPhL9TPAv828lrJFIUVERJdlRERKSc1dRKSE1NxFREpIzV1EpITU3EVESkjNXUSkhNTcRURK6P8DQvphtANyYsAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x108e820f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from playML.plot_utils import plot_decision_boundary\n",
    "\n",
    "plot_decision_boundary(dt_clf, axis=[0.5, 7.5, 0, 3])\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 如果改变max depth会是什么样呢？\n",
    "max_depth=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/seamonster/MachineLearningClassicAlgorithmEnv/lib/python3.6/site-packages/matplotlib/contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "i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Ua4prIfBYkBToAP7B3XMXJ8yxs4AfBrdS6AL+p7v/n3RLqtutwOPBqY03gZtTrqcuwS/VNcB/Sr2WokUhRUREp2VERApJzV1EpIDU3EVECkjNXUSkgNTcRUQKSM1dRKSA1NxFRAro/wN27Oarad+RMAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x108e95908>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf = DecisionTreeClassifier(max_depth=1, criterion='entropy')\n",
    "dt_clf.fit(X,y)\n",
    "plot_decision_boundary(dt_clf, axis=[0.5, 7.5, 0, 3])\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "max_depth=3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/seamonster/MachineLearningClassicAlgorithmEnv/lib/python3.6/site-packages/matplotlib/contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHF5JREFUeJzt3X+QHPWZ3/H3o91FEmKFwJKQkGQLCowPq87i2JLt04VQ54NCQBkXB4lI7BiX65S6AIH4UqmAUvyq47irVNlRgWOXAsRwduCMwI7uEHf4ypQBXQCvZHGAhM8KNpGEYAEhafUT7e6TP6Znd7a3d6enp2f6x3xeVVve/s53eh7k0rOj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Nk3gD5gtrtfmXU9jTCz3wB97l7IXwIys4eB5939gSCdd7K778+6rkYFY1v2AJ9197eyqKF079zd/TkqiZ1Ccve97r41+H4Q2EHlN4BzzysOBYc9wVeh3j2Y2WLgCuCBrGvpNGZ2KnARlfQd7v5RERt74AvA/82qsUMJm3uZmNlS4ALgpWwriS+4pLENGAB+4u6FqT3w34D/BISH+ReFA8+Y2ZZg3EeRnAW8B/zP4LLYA2Y2K+uiEloNPJplAWruOWVmpwBPALe4+8Gs64nL3YfdfTmV32ReYWaFuTRmZlcCA+6+JetamvB77v47VKa43hBcpiyKbuB3gO+4+wXAYeA/Z1tS44LLSV8EHs+yDjX3HAquVz8B/MDdn8y6niSCf04/C1yWdS0NWAl8Mbhu/Rjw+2b2/WxLaoy77wn+dwD4EZWprkWxG9hd86+9DVSafdGsAra6+7tZFqHmnjPBTckHgR3u/s2s62mEmc0zsznB9zOBS4A3sq0qPne/1d0Xu/tSKv+s/qm7fznjsmIzs1nBTXiCyxmXAoVJjbn7O8AuMzsvWPoCkPsgQYTryPiSDLR5KmQ7mNmjwMXAXDPbDdzh7g9mW1VDVgJfAV4Nrl0D3ObumzKsKa6FwMNBUmAa8EN3L1ycsMDOAH4UfJRCN/C/3P1vsy2pYTcBPwgubbwJfC3jehoS/FC9BPi3mddStiikiIjosoyISCmpuYuIlJCau4hICam5i4iUkJq7iEgJqbmLiJSQmruISAn9f8P7mdXpoTKJAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x109f644e0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf = DecisionTreeClassifier(max_depth=3, criterion='entropy')\n",
    "dt_clf.fit(X,y)\n",
    "plot_decision_boundary(dt_clf, axis=[0.5, 7.5, 0, 3])\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "max depth=4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/seamonster/MachineLearningClassicAlgorithmEnv/lib/python3.6/site-packages/matplotlib/contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHH9JREFUeJzt3X+QHPV55/H3sz+QhFghsCQkJGyZAuNgVSzClowjH0fFB4UwZVwE7sSdfcbliq5ywMElV1cHuuJXhZDUVdlRgc8uHXCG2IEYgR0liBinTBlQDvBKFgEkHOuwOUkIFhCSVugH2t3n/piZ3dne3p2enu7pH/N5VW0x/Z1v9zwSpWd7uz/7bXN3RESkXLqyLkBERJKn5i4iUkJq7iIiJaTmLiJSQmruIiIlpOYuIlJCDZu7mc00sxfN7CUze9XM7giZM8PM/trMdprZC2a2NI1iRUQkmihn7seA33P3TwPLgUvN7ILAnK8D77v7WcA3gT9PtkwREWlGw+buFYeqm73Vr+BvPl0BPFh9vQH4vJlZYlWKiEhTeqJMMrNuYAtwFvAtd38hMGUxsAvA3YfN7ADwEeDdwHHWAGsAZs+Ycf7ZCxe2Vr005b1ZH8m6BBFp0a7Xtr7r7vMbzYvU3N19BFhuZnOBH5rZMnd/pdmi3H09sB7gvKVL/em1a5s9hLTgweVfzboEEWnRTStmvBFlXlNpGXffDzwNXBp4aw9wBoCZ9QAnA+81c2wREUlOlLTM/OoZO2Y2C7gYeC0wbSNQOy28Cvipa0UyEZHMRLksswh4sHrdvQv4gbv/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H6aeBS7OupQkrgS9Wr1s/AvyemX0v25Ka4+57qv8dBH5IZVXXotgN7K77aW8DlWZfNKuAre7+dpZFqLnnTPWm5P3ADnf/Rtb1NMPM5pvZ3OrrWcDFwGvZVhWdu9/s7kvcfSmVH6t/6u5fzrisyMxsdvUmPNXLGZcAhUmNuftbwC4zO6c69Hkg90GCENeQ8SUZaPOqkO1gZg8DFwHzzGw3cJu7359tVU1ZCXwFeLl67RrgFnfflGFNUS0CHqwmBbqAH7h74eKEBXYa8MPqoxR6gL9y97/PtqSm3QB8v3pp43XgaxnX05TqN9WLgf+QeS1li0KKiIguy4iIlJKau4hICam5i4iUkJq7iEgJqbmLiJSQmruISAmpuYuIlND/BzAcicsJj8bjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x108e2ce80>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf = DecisionTreeClassifier(max_depth=4, criterion='entropy')\n",
    "dt_clf.fit(X,y)\n",
    "plot_decision_boundary(dt_clf, axis=[0.5, 7.5, 0, 3])\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
